package cn.cdeden.knowledge.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @ProjectName : ecm_hou
 * @Package : com.cdyd.ecm.file.enums
 * @ClassName : TreeEnum
 * @Author : Yu.
 * @Description : // TODO
 * @Date : 2022/8/29 10:05
 * @Version : 1.0
 */
@Getter
@AllArgsConstructor
public enum TreeTypeEnum {

    HEAD("head"),
    FILE("file"),
    FOLDER("folder"),
    RICHTEXT("richText"),



    /***************************企业模板库的TreeTypeEnum**********************************/
    TEMPLATE("template"),
    COMMUNITY_TEMPLATE("community"),
    COMPANY_TEMPLATE("company"),

    PERSONAL_TEMPLATE("personal"),
    PRE("pre"),
    THEME("theme");
    private final String type;


    public static TreeTypeEnum find(String type) {
        for (TreeTypeEnum value : TreeTypeEnum.values()) {
            if (StringUtils.equalsIgnoreCase(type,value.getType())) {
                return value;
            }
        }
        return FOLDER;
    }
}
